![]() |
PBVolumeMount |
||||
Header: | Files.h | Carbon status: | Supported | |
Mounts a volume, using either the information returned by the PBGetVolMountInfo function or a structure filled in by your application.
OSErr PBVolumeMount ( ParmBlkPtr paramBlock );
A pointer to a basic File Manager parameter block.
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion function.
On output, the result code of the function.
On output, a volume reference number for the mounted volume.
On input, a pointer to mounting information. If you’re mounting an AppleShare volume, place the volume’s AFP mounting information structure in the buffer pointed to by the ioBuffer field.
The PBGetVolMountInfo function does not return the user and volume passwords; they’re returned blank. Typically, your application asks the user for any necessary passwords and fills in those fields just before calling PBVolumeMount. If you want to mount a volume with guest status, pass an empty string as the user password.
If you have enough information about the volume, you can fill in the mounting structure yourself and call PBVolumeMount, even if you did not save the mounting information while the volume was mounted. To mount an AFP volume, you must fill in the structure with at least the zone name, server name, user name, user password, and volume password. You can lay out the fields in any order within the data field, as long as you specify the correct offsets.
AFP volumes currently ignore the user authentication method passed in the uamType field of the volume mounting information structure whose address is passed in ioBuffer. The most secure available method is used by default, except when a user mounts the volume as
This function allows your application to record the mounting information for a volume and then to mount the volume later. This programmatic mounting function stores the mounting information in a structure called the AFPVolMountInfo structure. The programmatic mounting functions use the ioParam variant of the ParamBlockRec structure.
In general, it is easier to mount remote volumes by creating and then resolving alias records that describe those volumes. The Alias Manager displays the standard user interface for user authentication when resolving alias records for remote volumes. As a result, this function is primarily of interest for applications that need to mount remote volumes with no user interface or with some custom user interface.
This function executes synchronously. You should not call it at interrupt time.
The File Sharing workstation software introduced in system software version 7.0 does not currently pass the volume password. The AppleShare 3.0 workstation software does, however, pass the volume password.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)